//
//  DGGViewController.m
//  DGGPhotoCameraSDK
//
//  Created by 伍明鹏 on 10/24/2020.
//  Copyright (c) 2020 伍明鹏. All rights reserved.
//

#import "DGGViewController.h"
#import "DLPhotoCameraUtil.h"

@interface DGGViewController ()

@property (nonatomic, strong) DLPhotoCameraUtil *photoCameraUtil;

@end

@implementation DGGViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)photoAction:(UIButton *)sender {
    self.photoCameraUtil.allowEditVideo = NO;
    self.photoCameraUtil.allowEditImage = YES;
    [self.photoCameraUtil showPhotoAlbumWithCurrentController:self preview:NO choosePhotoBlock:^(NSArray<UIImage *> * _Nonnull images, NSArray<PHAsset *> * _Nonnull assets, BOOL isOriginal) {
    } choosePhotoErrorBlock:^(NSArray<PHAsset *> * _Nonnull errorAssets, NSArray<NSNumber *> * _Nonnull errorIndex) {
    }];
}
- (IBAction)videoAction:(UIButton *)sender {
    self.photoCameraUtil.allowEditVideo = YES;
    self.photoCameraUtil.allowEditImage = NO;
    [self.photoCameraUtil showPhotoAlbumWithCurrentController:self preview:NO choosePhotoBlock:^(NSArray<UIImage *> * _Nonnull images, NSArray<PHAsset *> * _Nonnull assets, BOOL isOriginal) {
    } choosePhotoErrorBlock:^(NSArray<PHAsset *> * _Nonnull errorAssets, NSArray<NSNumber *> * _Nonnull errorIndex) {
    }];
}

- (DLPhotoCameraUtil *)photoCameraUtil {
    if (!_photoCameraUtil) {
        _photoCameraUtil = [[DLPhotoCameraUtil alloc] init];
        _photoCameraUtil.maxSelectCount = 20;
        _photoCameraUtil.navBarColor = [UIColor greenColor];
        _photoCameraUtil.tintColor = [UIColor redColor];
        _photoCameraUtil.indexLabelBgColor = [UIColor greenColor];
        _photoCameraUtil.bottomBtnsNormalBgColor = [UIColor greenColor];
    }
    return _photoCameraUtil;
}

@end
